package com.ruoyi.client.controller;

import com.ruoyi.client.pojo.vo.CategoryVo;
import com.ruoyi.client.service.CategoryService;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.domain.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.mybatis.logging.Logger;
import org.mybatis.logging.LoggerFactory;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@Anonymous
@CrossOrigin
@RestController("ClientCategoryController")
@Api(value = "v1", tags = "03.分类模块")
@RequestMapping("/category")
public class CategoryController {
    private static final Logger logger = LoggerFactory.getLogger(CategoryController.class);
    @Resource
    private CategoryService categoryService;

    /**
     * 查询商品分类列表（全部）
     */
    @ApiOperation(value = "查询商品分类的全部数据", notes = "商品分类页面使用")
    @GetMapping("/list")
    public R<List<CategoryVo>> list() {
        List<CategoryVo> categoryVoList = categoryService.selectVoList();
        return R.ok(categoryVoList);
    }

}